<?php
$columns = array(
    array(
        'class'=>'CCheckBoxColumn',
        'value'=>'$data->id',
        'htmlOptions'=>array('width'=>'3%','class'=>'checkbox-col','style'=>'text-align: center;'),
    ),
    array(
        'name'=>'title',
        'type'=>'raw',
        'value'=>'CHtml::link($data->title,array("/Cms/admin/page/update","id"=>$data->id))',
        'htmlOptions'=>array('width'=>'10%'),
    ),
    array(
        'name'=>'alias',
        'type'=>'raw',
        'value'=>'$data->alias',
        'htmlOptions'=>array('width'=>'10%'),
    ),
    array(
        'header'=>'Default URL',
        'type'=>'raw',
        'value'=>'(is_object($data->defaultUrl)) ? $data->defaultUrl->url : ""',
        'htmlOptions'=>array('width'=>'10%'),
    ),
    array(
        'header'=>'Live',
        'type'=>'raw',
        'value'=>'CHtml::image(Yii::app()->theme->baseUrl."/images/".(FSM::_run("Cms.workflow.isActiveInLive", array("page_id"=>$data->id))->status ? "log_severity1" : "delicon").".gif", "Live")',
        'htmlOptions'=>array('width'=>'2%','style'=>'text-align: center;'),
    ),
    array(
        'name'=>'status',
        'type'=>'raw',
        'filter'=>$model->getStatusOptions(),
        'value'=>'"<a class=\'".($data->status ? "active" : "")."\'>".$data->statusText."</a>"',
        'htmlOptions'=>array('width'=>'2%','class'=>'status-column'),
    ),
);

$grid = $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'pages-grid',
	'dataProvider'=>$model->searchByWorkflow(),
    'enableSorting'=>false,
	'filter'=>$model,
	'columns'=>$columns,
    'selectableRows'=>2,
    'afterAjaxUpdate'=>"js:function(){
        $('#AjaxLoading').hide();
    }",
));
?>

